const mysql = require('mysql');
const co = require('co-mysql'); //封装了promise的mysql操作
const config = require('./config');

const db = mysql.createPool({
  host: config.DB_HOST,
  user: config.DB_USER,
  password: config.DB_PASS,
  database: config.DB_NAME,
});

module.exports = co(db);